export default {
        namespaced:true,
        actions:{
            addOddFun(context,value){
                if(context.state.sum % 2){
                    context.commit('AFun',value)
                }
            },
            addWaitFun(context,value){
                setTimeout(()=>{
                    context.commit('AFun',value)
                },500)
            }
        },
        mutations:{
            AFun(state,value){
                // console.log('mutations中的addFun',state,value)
                state.sum += value
            },
            SFun(state,value){
                state.sum -= value
            }
        },
        state:{
            sum:0,//当前的和
            school:"MEO"
        },
        getters:{
            bigSum(state){
                return state.sum*10
            }
        }
}